/** \file
* Implementation of the Twitter status database class.
* This file is part of Chorus, available at
* http://code.google.com/p/chorus-twitter/ . This file and all associated files
* and derivative works are bound by the terms of the LGPL 3.0 license,
* available at http://www.gnu.org/licenses/lgpl-3.0-standalone.html .
* \par Subversion URL:
* \$URL: http://chorus-twitter.googlecode.com/svn/branches/cpp/src/twitter/StatusTree.cpp $
* \version \$Rev: 153 $
* \date    \$Date: 2010-04-06 07:43:42 +0000 (Tue, 06 Apr 2010) $
*/

#include "config.h"

#include "twitter/UserTree.hpp"
#include "twitter/StatusTree.hpp"

StatusTree::StatusTree(CurlGlob *curlGlobInit) :
	DefaultTree(curlGlobInit)
{
	users = 0;
	parsingUser = false;
}

StatusTree::~StatusTree()
{
}

void StatusTree::setUserTree(UserTree *usersInit)
{
	users = usersInit;
}

void StatusTree::startElement(const xmlChar *name, const xmlChar **attrs)
{
/*	if (parsingUser)
	{
		users->startElement(name, attrs);
		return;
	}

	if (xmlStrEqual(name, (const xmlChar*)"user"))
	{
		parsingUser = true;
		users->newPendingElement();
	}
	else*/
		XmlTree::startElement(name, attrs);
}

void StatusTree::endElement(const xmlChar *name)
{
/*	if (parsingUser)
	{
		users->endElement(name);
		if (!users->getPendingElement())
			parsingUser = false;
	}
	else*/
		XmlTree::endElement(name);
}

void StatusTree::elementText(const xmlChar *ch, unsigned len) 
{
/*	if (parsingUser)
	{
		XmlProperty *const userProp = users->currentProp;
		TypedXmlProperty<unsigned> *const userId = &users->pending->prop_id;
//		users->elementText(ch);
		if (userProp == userId)
			pending->by = userId->get();
	}
	else*/
		XmlTree::elementText(ch, len);
}
